package com.kx.hackathon.enums;

import com.kx.hackathon.service.HandlerService;

public enum CommandEnum {
    Calculator( "计算器", "计算"),
    Translate("翻译","双语互译"),
    Cyjl("成语接龙"),
    Baike("百科","百度百科"),
    Ddl("对对联"),
    Default( ""),
    TianQiYuBao("天气","天气预报","查天气")
    ;


    private final String[] commands;

    CommandEnum(String... commands) {
        this.commands = commands;
    }

    public static CommandEnum getByCommand(String command){
        for(CommandEnum ce: CommandEnum.values()){
            for(String c:ce.commands){
                if(c.equals(command)){
                    return ce;
                }
            }
        }
        return null;
    }
}
